//
//  CPYRankListDetailModel.m
//  TTMusic
//
//  Created by chenpengyu on 16/4/6.
//  Copyright © 2016年 cpy. All rights reserved.
//

#import "CPYRankListDetailModel.h"

@implementation CPYRankListDetailModel
- (id)initWithDataSource:(NSDictionary *)dataSource {
    self = [super initWithDataSource:dataSource];
    if (self) {
        NSMutableArray *arr = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in self.songs) {
            CPYDiscoveryPageSongListModel *songsMoel = [[CPYDiscoveryPageSongListModel alloc] initWithDataSource:dic];
            [arr addObject:songsMoel];
        }
        self.songs = [NSArray arrayWithArray:arr];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"image"]) {
        self.imageModel = [[CPYRankListDetailImageModel alloc] initWithDataSource:value];
    }
    if ([key isEqualToString:@"data"]) {
        self.songs = value;
    }
}


@end
